package com.xw.audioplayer;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.xw.floatlib.FloatActionController;

public class Main3Activity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);

        FloatActionController.getInstance().hide();

        findViewById(R.id.btn_last).setOnClickListener(this);
        findViewById(R.id.btn_pause).setOnClickListener(this);
        findViewById(R.id.btn_nest).setOnClickListener(this);
        findViewById(R.id.btn_cancle).setOnClickListener(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        FloatActionController.getInstance().show();
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()){

            case R.id.btn_last:
                FloatActionController.getInstance().lastMusic();
                break;

            case R.id.btn_pause:
                FloatActionController.getInstance().stop2Start();
                break;

            case R.id.btn_nest:
                FloatActionController.getInstance().nextMusic();
                break;

            case R.id.btn_cancle:
                FloatActionController.getInstance().remove();
                finish();
                break;


        }
    }
}
